<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        window.onload = function () {
            let buts = document.getElementsByTagName("button");
            let ulls = document.getElementsByTagName("ul");
            buts[0].onclick = function () {

                // alert(ulls[0].children.length);
                let li = document.createElement("li");
                li.innerHTML = "li第" + (ulls[0].children.length + 1) + "个";
                ulls[0].appendChild(li);

            };

        };
    </script>
</head>


<body>

<button>
    添加
</button>
<ul id="ull">

</ul>

</body>
</html>